package com.fy.fyzf.api;

import com.fy.fyzf.bean.AddHousingBean;
import com.fy.fyzf.bean.AddHousingBean1;
import com.fy.fyzf.bean.AddLookBean;
import com.fy.fyzf.bean.AddNoteBean;
import com.fy.fyzf.bean.AddOwner;
import com.fy.fyzf.bean.AddPassengerBean;
import com.fy.fyzf.bean.AddSignOne;
import com.fy.fyzf.bean.AddSignThree;
import com.fy.fyzf.bean.AddSignTwo;
import com.fy.fyzf.bean.AreaListBean;
import com.fy.fyzf.bean.BuildingDetailBean;
import com.fy.fyzf.bean.CheckWorkBean;
import com.fy.fyzf.bean.CheckWorkListBean;
import com.fy.fyzf.bean.CommonSearchBean;
import com.fy.fyzf.bean.DaiKanListBean;
import com.fy.fyzf.bean.DeleteImgBean;
import com.fy.fyzf.bean.DemandListBean;
import com.fy.fyzf.bean.ExChangeRecordBean;
import com.fy.fyzf.bean.ExchangeBean;
import com.fy.fyzf.bean.ExchangeBean1;
import com.fy.fyzf.bean.ExchangeDetailBean;
import com.fy.fyzf.bean.GetDemandDetailBean;
import com.fy.fyzf.bean.HomeBannerBean;
import com.fy.fyzf.bean.HouseDongBean;
import com.fy.fyzf.bean.HousesBean;
import com.fy.fyzf.bean.HousesListBean;
import com.fy.fyzf.bean.HousesListBean1;
import com.fy.fyzf.bean.HousingCountBean;
import com.fy.fyzf.bean.HousingDetailBean;
import com.fy.fyzf.bean.HousingFllowListBean;
import com.fy.fyzf.bean.HousingSearchBean;
import com.fy.fyzf.bean.IntegralRecordBean;
import com.fy.fyzf.bean.IntegralStoreBean;
import com.fy.fyzf.bean.IsInfoBean;
import com.fy.fyzf.bean.IssueDemandBean;
import com.fy.fyzf.bean.LoginBean;
import com.fy.fyzf.bean.LookOwnerBean;
import com.fy.fyzf.bean.MessageListBean;
import com.fy.fyzf.bean.MessageSendBean;
import com.fy.fyzf.bean.ModifySignBean;
import com.fy.fyzf.bean.MyRecommendBean;
import com.fy.fyzf.bean.NearBean;
import com.fy.fyzf.bean.NearHousingBean;
import com.fy.fyzf.bean.NewVersionBean;
import com.fy.fyzf.bean.OwnerListBean;
import com.fy.fyzf.bean.PassengerDetailBean;
import com.fy.fyzf.bean.PassengerListBean;
import com.fy.fyzf.bean.PassengerNumberBean;
import com.fy.fyzf.bean.DemanddetailBean;
import com.fy.fyzf.bean.RandomTextBean;
import com.fy.fyzf.bean.RecordBean;
import com.fy.fyzf.bean.RegisterBean;
import com.fy.fyzf.bean.BaseData;
import com.fy.fyzf.bean.ReleaseBean;
import com.fy.fyzf.bean.RulesBean;
import com.fy.fyzf.bean.SearchPassengerBean;
import com.fy.fyzf.bean.SignContractSearchBean;
import com.fy.fyzf.bean.SignDetailBean;
import com.fy.fyzf.bean.SignContractListBean;
import com.fy.fyzf.bean.UserInfoBean;
import com.fy.fyzf.bean.WorkLogBean;
import com.fy.fyzf.bean.WorkStepBean;

import java.util.List;

import okhttp3.MultipartBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;
import rx.Observable;

/**
 * @author ChayChan
 * @description: 网络请求的service
 * @date 2017/6/18  19:28
 */

public interface ApiService {

    String GET_ARTICLE_LIST = "api/news/feed/v62/?refer=1&count=20&loc_mode=4&device_id=34960436458&iid=13136511752";
    String GET_COMMENT_LIST = "article/v2/tab_comments/";
    //http://is.snssdk.com
    //http://is.snssdk.com/api/news/feed/v54/?refer=1&count=20&min_behot_time=1498722625&last_refresh_sub_entrance_interval=1498724693&loc_mode=4&tt_from=pull（tab_tip） 新闻列表
    //http://is.snssdk.com/article/v2/tab_comments/?group_id=6436886053704958466&item_id=6436886053704958466&offset=30&count=20 评论
    //http://is.snssdk.com/2/article/information/v21/ 详情

    @POST("app/user/login")
    @FormUrlEncoded
    Observable<BaseData<LoginBean>> userLogin(@Field("appIpAddress") String appIpAddress, @Field("userAccount") String userAccount, @Field("userPwd") String userPwd);

    @POST("app/housing/listN")
    Observable<BaseData<List<HousesListBean1>>> getHouseList(@Body AddHousingBean1 housesBean);

    /**
     * 地点查询接口
     */
    @POST("app/area/listClassification")
    @FormUrlEncoded
    Observable<BaseData<List<AreaListBean>>> listClassification(@Field("flag") Integer flag, @Field("parentId") Integer parentId);

    @GET("app/subway/findSubwayByParentId")
    Observable<BaseData<List<AreaListBean>>> findSubwayByParentId(@Query("id") int id);

    /**
     * 房源详情
     */
    @GET("app/housing/getHousingDetail")
    Observable<BaseData<HousingDetailBean>> getHousingDetail(@Query("housingId") Integer id);

    /**
     * 业主列表
     */
    @POST("app/owner/listOwner")
    Observable<BaseData<OwnerListBean>> listOwner(@Body LookOwnerBean lookOwnerBean);

    @GET("app/floor/fuzzyQueryFloor")
    Observable<BaseData<List<HousingSearchBean>>> fuzzyQueryFloor(@Query("floorName") String floorName);

    @POST("app/floor/floorList")
    @FormUrlEncoded
    Observable<BaseData<HouseDongBean>> floorList(@Field("floorId") Integer floorId);

    @Multipart
    @POST("app/fileSave/uploadNotMark")
    Observable<BaseData> uploadImg(@Part MultipartBody.Part body);

    @POST("app/housing/housingAdd")
    Observable<BaseData> housingAdd(@Body AddHousingBean addHousingBean);

    @POST("app/customer/listCustomerByPage")
    Observable<BaseData<PassengerListBean>> listCustomerByPage(@Body SearchPassengerBean searchPassengerBean);

    @GET("app/customer/getCustomerDetail")
    Observable<BaseData<PassengerDetailBean>> getCustomerDetail(@Query("customerId") int id);

    @POST("app/housing/collect/listCollectHousing")
    Observable<BaseData<HousesListBean>> listCollectHousing(@Body SearchPassengerBean searchPassengerBean);

    @POST("app/housing/housingEdit")
    Observable<BaseData> housingEdit(@Body AddHousingBean addHousingBean);

    @POST("app/housing/collect/list")
    Observable<BaseData<HousesListBean>> getMatchHousingList(@Body SearchPassengerBean searchPassengerBean);

    //添加房源收藏
    @POST("app/housing/collect/addCollectHousing")
    Observable<BaseData> addCollectHousing(@Body SearchPassengerBean searchPassengerBean);

    //取消收藏
    @POST("app/housing/collect/removeCollectHousing")
    Observable<BaseData> removeCollectHousing(@Body SearchPassengerBean searchPassengerBean);

    //推荐房源
    @POST("app/housing/recommendHousing")
    Observable<BaseData<HousesListBean>> recommendHousing(@Body SearchPassengerBean searchPassengerBean);

    //添加客源
    @POST("app/customer/addCustomer")
    Observable<BaseData> addCustomer(@Body AddPassengerBean addPassengerBean);

    @POST("app/area/allArea")
    @FormUrlEncoded
    Observable<BaseData<List<AreaListBean>>> getallArea(@Field("cityId") Integer cityId, @Field("flag") Integer flag);

    //修改客源
    @POST("app/customer/editCustomer")
    Observable<BaseData> editCustomer(@Body AddPassengerBean addPassengerBean);

    //签约列表
    @GET("app/customersPerformance/list")
    Observable<BaseData<SignContractListBean>> getSignContractList(@Query("pageNum") int pageSize, @Query("pageSize") int pageNum);

    @POST("app/customersPerformance/listCustomer")
    Observable<BaseData<SignContractListBean>> getSignContractList1(@Body SignContractSearchBean signContractSearchBean);

    //添加签约 三步走
    @POST("app/customersPerformance/addOne")
    Observable<BaseData> addSignOne(@Body AddSignOne addSignOne);

    @POST("app/customersPerformance/updateTwo")
    Observable<BaseData> addSigntTwo(@Body AddSignTwo addSignTwo);

    @POST("app/customersPerformance/updateThree")
    Observable<BaseData> addSignThree(@Body AddSignThree addSignThree);

    @GET("app/customer/listCustomerNumber")
    Observable<BaseData<List<PassengerNumberBean>>> listCustomerNumber();

    @GET("app/customersPerformance/details")
    Observable<BaseData<SignDetailBean>> getSignDetail(@Query("performanceId") Integer performanceId);

    @POST("app/takeLook/add")
    Observable<BaseData<AddLookBean>> addLook(@Body AddLookBean addLookBean);

    //带看列表
    @GET("app/takeLook/listTakeLook")
    Observable<BaseData<List<DaiKanListBean>>> getAddLookList(@Query("customerId") Integer customerId);

    //添加带看笔记
    @POST("app/housingFollow/add")
    Observable<BaseData> addNote(@Body AddNoteBean addNoteBean);

    //获取验证码
    @POST("app/sm/send")
    Observable<BaseData> getCode(@Body MessageSendBean messageSendBean);

    //注册
    @POST("app/join/add")
    Observable<BaseData> joinUs(@Body RegisterBean registerBean);

    //需求列表
    @POST("app/releaseRequirements/listRelease")
    Observable<BaseData<DemandListBean>> getDemandList(@Body CommonSearchBean commonSearchBean);

    //添加业主
    @POST("app/owner/addOwner")
    Observable<BaseData> addOwner(@Body AddOwner addOwner);

    //修改房源删除房源图片接口

    @POST("app/housing/delHousingImage")
    Observable<BaseData> delHousingImage(@Body DeleteImgBean deleteImgBean);

    @POST("app/housing/delHousing")
    @FormUrlEncoded
    Observable<BaseData> delHousing(@Field("housingId")  Integer housingId);
    @GET("app/housingFollow/list")
    Observable<BaseData<HousingFllowListBean>> housingFollow(@Query("housingId") int id);

    @POST("app/user/getUserInfo")
    @FormUrlEncoded
    Observable<BaseData<UserInfoBean>> getUserInfo(@Field("id") Integer cityId);

    //消息列表
    @POST("app/msg/checkWorkList")
    @FormUrlEncoded
    Observable<BaseData<MessageListBean>> getMessageList(@Field("pageNum") Integer pageNum, @Field("pageSize") Integer pageSize);

    //设置消息已读
    @POST("app/msg/updateMsgForRead")
    @FormUrlEncoded
    Observable<BaseData> updateMsgForRead(@Field("msgId") int msgId);

    //打卡
    @POST("app/checkWork/addCheckWork")
    Observable<BaseData> addCheckWork(@Body CheckWorkBean checkWorkBean);

    //考勤列表
    @POST("app/checkWork/checkWorkList")
    Observable<BaseData<CheckWorkListBean>> checkWorkList(@Body CommonSearchBean commonSearchBean);

    //积分商城列表
    @GET("app/integralMall/listIntegralMall")
    Observable<BaseData<IntegralStoreBean>> listIntegralMall(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize, @Query("type") int type);

    @POST("app/integralMall/exchangeMall")
    Observable<BaseData<ExchangeBean>> exchangeMall(@Body ExchangeBean exchangeBean);

    //兑换详情
    @POST("app/integralMall/getExchangeDetails")
    Observable<BaseData<ExchangeDetailBean>> getExchangeDetail(@Body ExchangeBean exchangeBean);

    //兑换记录
    @POST("app/integralMall/listExchangeDetails")
    Observable<BaseData<ExChangeRecordBean>> getExchangeRecord(@Body CommonSearchBean commonSearchBean);

    @POST("app/integral/details")
    Observable<BaseData<IntegralRecordBean>> getIntegralRecord(@Body CommonSearchBean commonSearchBean);

    //保存用户信息
    @POST("app/user/saveUserInfo")
    @FormUrlEncoded
    Observable<BaseData> saveUserInfo(@Field("userPortrait") String userPortrait, @Field("userSex") int userSex, @Field("userMobile") String userMobile
            , @Field("userEntryTime") String userEntryTime, @Field("userCard") String userCard, @Field("userAddress") String userAddress, @Field("userHousehold") String userHousehold, @Field("userName") String userName);


    //退出登录
    @POST("app/user/exit")
    @FormUrlEncoded
    Observable<BaseData> loginOut(@Field("token") String token);

    //分享回调添加积分
    @POST("app/integral/addIntegral")
    @FormUrlEncoded
    Observable<BaseData> addIntegral(@Field("token") String token);

    //发布需求
    @POST("app/releaseRequirements/addRelease")
    Observable<BaseData> issueDemand(@Body IssueDemandBean issueDemandBean);

    //需求详情
    @POST("app/releaseRequirements/detailsRelease")
    Observable<BaseData<DemanddetailBean>> demandDetail(@Body GetDemandDetailBean commonSearchBean);

    //我的需求列表
    @POST("app/releaseRequirements/myNeeds")
    Observable<BaseData<DemandListBean>> myDemand(@Body CommonSearchBean commonSearchBean);

    //删除消息
    @POST("app/msg/delMsg")
    @FormUrlEncoded
    Observable<BaseData> deleteMsg(@Field("msgId") Integer msgId);

    //推荐房源
    @POST("app/releaseRequirements/addRecommendHousing")
    Observable<BaseData> addRecommendHousing(@Body AddHousingBean addHousingBean);

    //根据经纬度查询楼盘
    @POST("app/floor/floorNearbyListPage")
    Observable<BaseData<NearHousingBean>> floorNearbyListPage(@Body NearBean nearBean);

    @POST("app/statistics/indexStatistics")
    @FormUrlEncoded
    Observable<BaseData<HousingCountBean>> getHousingCount(@Field("id") int id);

    @POST("app/floor/floorListPage")
    Observable<BaseData<HousesListBean>> getfloorList(@Body HousesBean housesBean);

    //banner
    @POST("app/dict/listBanner")
    @FormUrlEncoded
    Observable<BaseData<List<HomeBannerBean>>> banner(@Field("name") String name);

    //楼盘详情
    @POST("app/floor/floorDetails")
    @FormUrlEncoded
    Observable<BaseData<BuildingDetailBean>> floorDetails(@Field("floorId") Integer floorId);

    //不分页的房源列表
    @POST("app/housing/listN")
    Observable<BaseData<HousesListBean>> getAllHouseList(@Body AddHousingBean1 housesBean);

    //需求编辑发布
    @POST("app/releaseRequirements/edit")
    Observable<BaseData> editDemand(@Body IssueDemandBean issueDemandBean);

    @POST("/app/releaseRequirements/delRelease")
    Observable<BaseData> delRelease(@Body ReleaseBean releaseBean);

    @POST("app/releaseRequirements/listMyRecommend")
    Observable<BaseData<MyRecommendBean>> listMyRecommend(@Body GetDemandDetailBean getDemandDetailBean);

    @POST("app/user/isInfo")
    @FormUrlEncoded
    Observable<BaseData<IsInfoBean>> isInfo(@Field("id") int id);

    @POST("app/msg/countUnReadMsg")
    @FormUrlEncoded
    Observable<BaseData> getMsgCount(@Field("t") String id);

    @POST("app/msg/allRead")
    @FormUrlEncoded
    Observable<BaseData> setAllRead(@Field("id") int id);

    @GET("app/integral/rule")
    Observable<BaseData<List<RulesBean>>> getRules();

    //修改密码
    @POST("app/user/editPassword")
    @FormUrlEncoded
    Observable<BaseData> changePassWord(@Field("newPwd") String newPwd, @Field("oldPwd") String oldPwd);

    //商品兑换记录
    @GET("app/integralMall/listExchangeDetails")
    Observable<BaseData<List<RecordBean>>> listExchangeDetails();

    @POST("/app/version/getAppNewVersion")
    @FormUrlEncoded
    Observable<BaseData<NewVersionBean>> getNewVersion(@Field("versionType") String i);

    @POST("app/customersPerformance/updateCustomersPerformanceParam")
    Observable<BaseData> updateSignContract(@Body ModifySignBean modifySignBean);

    @POST("app/checkWork/workingSteps")
    @FormUrlEncoded
    Observable<BaseData<WorkStepBean>> workingSteps(@Field("versionType") String i);

    @POST("app/checkWork/addWorkLog")
    Observable<BaseData> addWorkLog(@Body WorkLogBean workLogBean);

    @POST("app/checkWork/addGoToWork")
    Observable<BaseData> addGoToWork(@Body CheckWorkBean checkWorkBean);

    @POST("app/checkWork/addGoOut")
    Observable<BaseData> addGoOut(@Body CheckWorkBean checkWorkBean);

    @POST("app/checkWork/addGoOffWork")
    Observable<BaseData> addGoOffWork(@Body CheckWorkBean checkWorkBean);

    @GET("/app/dict/randDict")
    Observable<BaseData<RandomTextBean>> randDict();

    //我的房源列表
    @POST("app/housing/listMe")
    Observable<BaseData<HousesListBean>> myHousingList(@Body CommonSearchBean commonSearchBean);

}

